package cn.cdutetc.library.entity.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 用户状态枚举
 */
@Getter
@AllArgsConstructor
public enum UserStatusEnum {
    // 对齐数据库/开发文档的取值
    ACTIVE("active", "正常"),
    INACTIVE("inactive", "停用");
    
    private final String code;
    private final String desc;
    
    public static UserStatusEnum getByCode(String code) {
        for (UserStatusEnum status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return null;
    }
}